#ifndef TABULAR_H
#define TABULAR_H
#include "rkvector.h"

typedef struct TabularCPD_t
{
  int numrows;
  int numcols;
  RkVector_t ** p_rows;
  
  int numargs;                               /* number of arguments */
  int * p_arg_card;             /* the cardinality of each argument */

} TabularCPD_t;

/* give the RkVector parameters */
void TabularCPD_Init_Params(TabularCPD_t * dist, int nparams, ...);
/* give the cardinality of each argument */
void TabularCPD_Init_Args(TabularCPD_t * dist, int nargs, ...);
int TabularCPD_Sample(const TabularCPD_t * dist, int nargs, ...);
double TabularCPD_Prob(const TabularCPD_t * dist, int val, int nargs, ...);
double TabularCPD_LogProb(const TabularCPD_t * dist, int val, int nargs, ...);

#endif /* TABULAR_H */
